<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>出库单据 - WMS仓库管理系统</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/outbound.css">
</head>
<body>
    <div class="container">
        <!-- 登录界面 -->
        <section id="loginSection" class="login-section">
            <div class="login-container">
                <h2>WMS仓库管理系统登录</h2>
                <form id="loginForm">
                    <div class="form-group">
                        <label for="username">用户名:</label>
                        <input type="text" id="username" required>
                    </div>
                    <div class="form-group">
                        <label for="password">密码:</label>
                        <input type="password" id="password" required>
                    </div>
                    <button type="submit" class="btn-primary">登录</button>
                    <p>默认管理员账号: admin / 123456</p>
                </form>
            </div>
        </section>

        <!-- 主内容界面 -->
        <div id="mainContent" class="main-content">
            <header>
                <h1>出库单据管理</h1>
                <p>管理出库单据的创建、审批和执行</p>
                <div class="header-actions">
                    <a href="index.html" class="btn-secondary">返回首页</a>
                    <button id="logoutBtn" class="btn-secondary">退出登录</button>
                </div>
            </header>

            <main>
                <nav class="module-nav">
                    <ul>
                        <li><a href="#create-outbound" class="active">创建出库单据</a></li>
                        <li><a href="#outbound-list">出库单据列表</a></li>
                        <li><a href="#outbound-approval">出库审批</a></li>
                    </ul>
                </nav>

                <!-- 创建出库单据 -->
                <section id="create-outbound" class="module-section active">
                    <h2>创建出库单据</h2>
                    <form id="createOutboundForm" class="document-form">
                        <div class="form-row">
                            <div class="form-group">
                                <label for="outboundDocumentId">单据编号:</label>
                                <input type="text" id="outboundDocumentId" required>
                            </div>
                            <div class="form-group">
                                <label for="outboundCustomer">客户:</label>
                                <input type="text" id="outboundCustomer" required>
                            </div>
                            <div class="form-group">
                                <label for="outboundDate">出库日期:</label>
                                <input type="date" id="outboundDate" required>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group">
                                <label for="outboundOperator">操作员:</label>
                                <input type="text" id="outboundOperator" required>
                            </div>
                            <div class="form-group">
                                <label for="outboundWarehouse">仓库:</label>
                                <select id="outboundWarehouse" required>
                                    <option value="">请选择仓库</option>
                                    <option value="WH01">WH01</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="outboundStatus">状态:</label>
                                <select id="outboundStatus" required>
                                    <option value="pending">待审批</option>
                                    <option value="approved">已审批</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group">
                                <label for="outboundRemarks">备注:</label>
                                <textarea id="outboundRemarks" rows="3"></textarea>
                            </div>
                        </div>
                        <button type="submit" class="btn-primary">创建出库单据</button>
                    </form>
                </section>

                <!-- 出库单据列表 -->
                <section id="outbound-list" class="module-section">
                    <h2>出库单据列表</h2>
                    <div class="filter-section">
                        <div class="filter-row">
                            <div class="form-group">
                                <label for="outboundListDocumentId">单据编号:</label>
                                <input type="text" id="outboundListDocumentId">
                            </div>
                            <div class="form-group">
                                <label for="outboundListCustomer">客户:</label>
                                <input type="text" id="outboundListCustomer">
                            </div>
                            <div class="form-group">
                                <label for="outboundListStatus">状态:</label>
                                <select id="outboundListStatus">
                                    <option value="">全部</option>
                                    <option value="pending">待审批</option>
                                    <option value="approved">已审批</option>
                                    <option value="completed">已完成</option>
                                    <option value="rejected">已拒绝</option>
                                </select>
                            </div>
                        </div>
                        <div class="filter-actions">
                            <button id="outboundListSearchBtn" class="btn-primary">查询</button>
                            <button id="outboundListResetBtn" class="btn-secondary">重置</button>
                        </div>
                    </div>
                    <div class="table-container">
                        <table class="document-table">
                            <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>单据编号</th>
                                    <th>客户</th>
                                    <th>出库日期</th>
                                    <th>操作员</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 出库单据列表将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                    </div>
                </section>

                <!-- 出库审批 -->
                <section id="outbound-approval" class="module-section">
                    <h2>出库审批</h2>
                    <div class="filter-section">
                        <div class="filter-row">
                            <div class="form-group">
                                <label for="approvalOutboundDocumentId">单据编号:</label>
                                <input type="text" id="approvalOutboundDocumentId">
                            </div>
                            <div class="form-group">
                                <label for="approvalOutboundCustomer">客户:</label>
                                <input type="text" id="approvalOutboundCustomer">
                            </div>
                            <div class="form-group">
                                <label for="approvalOutboundStatus">状态:</label>
                                <select id="approvalOutboundStatus">
                                    <option value="pending">待审批</option>
                                </select>
                            </div>
                        </div>
                        <div class="filter-actions">
                            <button id="approvalOutboundSearchBtn" class="btn-primary">查询</button>
                            <button id="approvalOutboundResetBtn" class="btn-secondary">重置</button>
                        </div>
                    </div>
                    <div class="table-container">
                        <table class="document-table">
                            <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>单据编号</th>
                                    <th>客户</th>
                                    <th>出库日期</th>
                                    <th>操作员</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- 待审批出库单据列表将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                    </div>
                </section>
            </main>
        </div>

        <!-- 出库单据详情模态框 -->
        <div id="outboundDetailModal" class="modal">
            <div class="modal-content">
                <span class="close">&times;</span>
                <h2>出库单据详情</h2>
                <div class="document-detail">
                    <h3>基本信息</h3>
                    <div class="detail-grid">
                        <div class="detail-item">
                            <span class="detail-label">单据编号:</span>
                            <span class="detail-value" id="outboundDetailDocumentId"></span>
                        </div>
                        <div class="detail-item">
                            <span class="detail-label">客户:</span>
                            <span class="detail-value" id="outboundDetailCustomer"></span>
                        </div>
                        <div class="detail-item">
                            <span class="detail-label">出库日期:</span>
                            <span class="detail-value" id="outboundDetailDate"></span>
                        </div>
                        <div class="detail-item">
                            <span class="detail-label">操作员:</span>
                            <span class="detail-value" id="outboundDetailOperator"></span>
                        </div>
                        <div class="detail-item">
                            <span class="detail-label">仓库:</span>
                            <span class="detail-value" id="outboundDetailWarehouse"></span>
                        </div>
                        <div class="detail-item">
                            <span class="detail-label">状态:</span>
                            <span class="detail-value" id="outboundDetailStatus"></span>
                        </div>
                    </div>
                    <div class="detail-item">
                        <span class="detail-label">备注:</span>
                        <span class="detail-value" id="outboundDetailRemarks"></span>
                    </div>
                </div>
                <div class="document-detail">
                    <h3>货物明细</h3>
                    <div class="table-container">
                        <table class="document-table">
                            <thead>
                                <tr>
                                    <th>物料编码</th>
                                    <th>物料名称</th>
                                    <th>规格型号</th>
                                    <th>数量</th>
                                    <th>单位</th>
                                </tr>
                            </thead>
                            <tbody id="outboundDetailItems">
                                <!-- 货物明细将通过JavaScript动态加载 -->
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="modal-actions">
                    <button id="outboundApproveBtn" class="btn-primary">审批通过</button>
                    <button id="outboundRejectBtn" class="btn-secondary">拒绝</button>
                </div>
            </div>
        </div>
    </div>

    <script src="js/outbound.js"></script>
</body>
</html>